package net.jiastudy.web.rest.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.jiastudy.core.base.BaseController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/version")
@PropertySource("classpath:config/version.properties")
@Api(value = "VersionController  版本")
public class VersionController extends BaseController {
    @Value("${version}")
    private String version;

    @RequestMapping(method = RequestMethod.GET)
    @ApiOperation(value = "查看版本")
    public Map<String, String> get() {
        Map<String, String> result = new HashMap<>();
        result.put("version", version);
        return result;
    }
}
